package rent.hj.launcher;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.annotation.NonNull;
import android.support.annotation.StyleRes;
import android.view.KeyEvent;

/**
 * Created by admin on 2017/12/19.
 */

public class CustomDialog extends Dialog{

    public CustomDialog(@NonNull Context context, @StyleRes int theme) {
        super(context, theme);

        setOnKeyListener(new OnKeyListener() {
            @Override
            public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {

                if (keyCode == KeyEvent.KEYCODE_BACK){
                    return true;
                }

                return false;
            }
        });
    }
}
